/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package validation;
import model.UserBean;
/**
 *
 * @author Jagadeesh
 */
public class ValidateForm {
    
        
    UserBean validBean = new UserBean();
    public UserBean validateData(UserBean ubean)
    {
//        boolean isUserValid=false;
//        boolean isDobValid=false;
//        boolean isEmailValid=false;
//        boolean isPhoneValid=false;
//        int terserah=0;
        validBean.setIsValid(true);
        //if given username value is not valid then seterror message and set empty value to input
        //field
        if(ubean.getUserName().length()==0)
        {
            validBean.setUserNameError("please enter valid name");
	    validBean.setIsValid(false);
            validBean.setUserName("");
        }
          //if given username value is valid then seterror message to empty and set value to bean
	else
        {
	    validBean.setUserNameError("");
            validBean.setUserName(ubean.getUserName());
	}
        

        //if given username value is not valid then seterror message and set empty value to input
        //field
        
       
        return validBean;
    }
}
